#include <stdio.h>
#include <chrono>
#include <unistd.h>
#include <fcntl.h>
#include <fstream>
#include <vector>
#include <filesystem>
#include "Util/logc.h"
#include "V520DDevice.h"


using  namespace  HidDeviceNameSpace;

V520DDevice::V520DDevice(const std::string& device_path, std::string& product_model, const std::string& product_name, const std::string& phy_version, 
        const std::string& soft_version, const std::string& serial_number, 
        const std::string& unique_id, std::vector<HidDevInfo> sub_devices):HidDevice(device_path, product_model, product_name, phy_version, 
        soft_version, serial_number, unique_id, sub_devices){
    m_upgrade = std::make_shared<DeviceUpgradeUtil>(VIDEOSERIES);
}

V520DDevice::~V520DDevice(){
    
}


bool V520DDevice::Upgrade(const std::string& file_path){
    std::lock_guard<std::recursive_mutex> guard(m_mux);
    return m_upgrade->Upgrade(m_device_file_path, file_path);
}



